<?php
/**
 * Created by PhpStorm.
 * User: eugene
 * Date: 2018/4/26
 * Time: 14:03
 */

namespace App\Transformers;


use App\Models\UserDrawLotsLog;
use Carbon\Carbon;

class CardTransformer extends Transformer
{
    
    public function transform($item)
    {
        return [
            'id'=>$item->id,
            'name'=>$item->name,
            'desc'=>$item->descr,
            'img'=>$item->img,
            'rarity'=>$item->rarity,
            'series_num'=>$item->card_series_id.'-'.$item->num,
            'start_time'=>Carbon::parse($item->startTime)->toDateString(),
            'hold'=>0,
            'is_new'=>0,
        ];
    }
}